package com.yunhe.policyfulfillment.authority.repository;

import com.yunhe.policyfulfillment.authority.domain.PolicyUser;
import com.yunhe.policyfulfillment.authority.model.PolicyUserQueryCondition;
import com.yunhe.policyfulfillment.authority.model.UserLogin;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 政策兑现后台用户
 * @author hetao
 * @date 2021/07/22
 */
@Repository
public interface IPolicyUserRepository{

    /**
     * 新增
     * @author hetao
     * @date 2021/07/22
     **/
    int createPolicyUser(PolicyUser policyUser);

    /**
     * 新增
     * @author hetao
     * @date 2021/07/22
     **/
    int createPolicyUserSelective(PolicyUser policyUser);

    /**
     * 刪除
     * @author hetao
     * @date 2021/07/22
     **/
    int deletePolicyUserByPrimaryKey(@Param("id") Long id);

    /**
     * 更新
     * @author hetao
     * @date 2021/07/22
     **/
    int updatePolicyUserByPrimaryKey(PolicyUser policyUser);

    /**
     * 更新
     * @author hetao
     * @date 2021/07/22
     **/
    int updatePolicyUserByPrimaryKeySelective(PolicyUser policyUser);

    /**
     * 根据主键查询
     * @author hetao
     * @date 2021/07/22
     **/
    PolicyUser searchPolicyUserByPrimaryKey(@Param("id") Long id);

    PolicyUser backPolicyUserlLogin(UserLogin userLogin);

    List<PolicyUser> findPolicyUsers();

    String getUserName(Long publishPerson);

    List<PolicyUser> findPolicyUsersByOrgId(@Param("orgId") int currentAuditOrg);

    List<PolicyUser> findPolicyUserByUserAccount(@Param("userAccount") String userAccount);

    List<PolicyUser> findPolicyUserByCondition(PolicyUserQueryCondition policyUserQueryCondition);

    void updatePassword(@Param("id") Long id, @Param("password") String password, @Param("updatePerson") Long updatePerson);

    void updateActivity(@Param("id") Long ids, @Param("activity") String activity, @Param("remark") String remark, @Param("updatePerson") Long updatePerson);

    List<PolicyUser> findPolicyUsersByRoleId(@Param("roleId") Long roleId);

    /**
     * 用户解绑角色
     * @param id 用户id
     **/
    void unbindRole(@Param("id") Long id);
}
